<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> -->
<!-- <meta name="description" content=""> -->
<!-- <meta name="author" content=""> -->

<title>CMS后台管理系统</title>

<!-- Bootstrap core CSS-->
<link href="/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template-->
<link href="/libs/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<!-- 富文本编辑插件 -->
<!-- Custom styles for this template-->
<link href="/libs/sb-admin/sb-admin.css" rel="stylesheet">

</head>

<body id="page-top">

	<!-- 后台管理系统顶部 -->
	<jsp:include page="_inc_top.jsp" />

	<div id="wrapper">

		<!-- 后台管理系统左部菜单 -->
		<jsp:include page="_inc_left.jsp" />

		<div id="content-wrapper">

			<div class="container-fluid">

				<!-- 面包屑 -->
				<ol class="breadcrumb">
					<li class="breadcrumb-item"><a href="/admin/home">后台首页</a></li>
					<li class="breadcrumb-item active">栏目管理</li>
				</ol>

				<!-- Page Content -->
				<h1>栏目添加</h1>

				<hr>
				<div class="card">
					<div class="card-body">
						<form name="channel" action="/channel/edit" enctype="multipart/form-data" method="post">
							<input type="hidden" name="id" value="${channel.id }"/>
							<p class="red">${message }</p>
							<p>
								<input name="name" class="form-control col-md-8" placeholder="栏目名称" value="${channel.name }"/>
							</p>
							<br />
							<br />
							<p id="content-rich-edit">
								<textarea name="description" id="description" rows="20" class="form-control" onfocus="if(value=='请输入具体内容'){value=''}"  onblur="if (value ==''){value='请输入具体内容'}"><c:if test="${channel.description== null ||channel.description== ''}">请输入具体内容 </c:if>${channel.description}</textarea>
								</span>
							</p>

							<p>
								上传图标：<input type="file" name="file" />
								<c:if test="${not empty channel.icon}">
									<input type="hidden" name="isDelCover" value="0" />
									<span id="coverBox"> <img alt="图片预览" src="${channel.icon}" height="50"> <a id="deleteCover" href="javascript:void(0)">删除图片</a>
									</span>
								</c:if>
							</p>

							<p>
								<button type="submit" class="btn btn-info btn-block">保存</button>
							</p>

						</form>
					</div>
				</div>
			</div>
			<!-- /.container-fluid -->

			<!-- Sticky Footer -->
			<footer class="sticky-footer">
				<div class="container my-auto">
					<div class="copyright text-center my-auto">
						<span>Copyright © Your Website 2018</span>
					</div>
				</div>
			</footer>

		</div>
		<!-- /.content-wrapper -->

	</div>
	<!-- /#wrapper -->

	<!-- Scroll to Top Button-->
	<a class="scroll-to-top rounded" href="#page-top"> <i class="fas fa-angle-up"></i>
	</a>

	<!-- Logout Modal-->
	<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
					<button class="close" type="button" data-dismiss="modal" aria-label="Close">
						<span aria-hidden="true">×</span>
					</button>
				</div>
				<div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
				<div class="modal-footer">
					<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
					<a class="btn btn-primary" href="/user/login">Logout</a>
				</div>
			</div>
		</div>
	</div>

	<!-- Bootstrap core JavaScript-->
	<script src="/libs/jquery/jquery.min.js"></script>
	<script src="/libs/bootstrap/js/bootstrap.bundle.min.js"></script>

	<!-- Custom scripts for all pages-->
	<script src="/libs/sb-admin/sb-admin.min.js"></script>

	<script type="text/javascript">
		$(document).ready(function() {

			$("#deleteCover").click(function() {
				$(this).parent().empty();
				$("input[name=isDelCover]").val("1");
			});

		});
	</script>

</body>

</html>
